<template>
    <div>
        aa
        <!--添加医生界面-->
        <el-form style="margin-top: 30px" label-width="180px" :model="form">
            <el-form-item label="医院名称:">
                <el-input v-model="form.name" clearable style="width: 220px"></el-input>
            </el-form-item>

            <el-form-item label="医院简介:">
                <el-input v-model="form.synopsis" clearable style="width: 220px"></el-input>
            </el-form-item>

            <el-form-item label="是否上架:">
                <el-input v-model="form.boole" clearable style="width: 220px"></el-input>
            </el-form-item>

            <el-form-item label="医院类型:">
                <el-select v-model="form.type" placeholder="请选择">
                    <el-option label="全部" :value=null></el-option>
                    <el-option v-for="n in types" :key="n.id" :label="n.content"
                               :value="n.value"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="医院等级:">
                <el-select v-model="form.grade" placeholder="请选择">
                    <el-option label="全部" :value=null></el-option>
                    <el-option v-for="n in grades" :key="n.id" :label="n.content"
                               :value="n.value"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="一级科室:">
                <el-select v-model="form.firstLevelId" placeholder="请选择" lable="一级科室">
                    <el-option label="全部" :value=null></el-option>
                    <el-option v-for="n in firstLevels" :key="n.id" :label="n.name" :value="n.id"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="二级科室:">
                <el-select v-model="form.secondLevelId" placeholder="请选择">
                    <el-option label="全部" :value=null></el-option>
                    <el-option v-for="n in secondLevels" :key="n.id" :label="n.name" :value="n.id"></el-option>
                </el-select>
            </el-form-item>
        </el-form>

        <!--操作-->
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" icon="el-icon-search" @click="submit" size="medium">确定</el-button>
            <el-button @click="cancelForm">取消</el-button>
        </div>
    </div>
</template>


<script>
    export default {
        name: "SaveDocker",
        props:'form',
        data() {
            return {
                form:{
                    synopsis:null, boole:null, secondLevelId:null
                },      //添加医院对象
                types:[],       //所有医院类型
                grades:[],      //所有医院等级
                firstLevels:[], //所有一级科室
                secondLevels:[],//所有二级科室
            }
        },
        methods: {
            //数据初始化
            initData() {
                //查询所有医院类型
                this.$axios.get('/ms_dictionary/findByTypeId?typeId=5').then(resp => {
                    this.types = resp.data.data;
                });
                //查询所有医院等级
                this.$axios.get('/ms_dictionary/findByTypeId?typeId=4').then(resp => {
                    this.grades = resp.data.data;
                });
                //查询所有一级科室
                this.$axios.get('/ms_department/findFirstLevels').then(resp => {
                    this.firstLevels = resp.data.data;
                });
                //查询所有二级科室
                this.$axios.get('/ms_department/findSecondLevels').then(resp => {
                    this.secondLevels = resp.data.data;
                });
                this.form=this.$route.params.form;
            },
        },
        created() {
            this.initData();
        }
    }
</script>


<style scoped>
    .text {
        font-size: 14px;
    }

    .item {
        margin-bottom: 18px;
    }

    .clearfix:before,
    .clearfix:after {
        display: table;
        content: "";
    }

    .clearfix:after {
        clear: both
    }

    .box-card {
        width: 480px;
    }
</style>